package modele.contact;

import modele.adresse.Adresse;
import modele.mail.AdresseMail;
import modele.mail.AdresseMailPro;


public class Professionnel extends Personne {
	private String numBur;
	private AdresseMailPro sonMailPro;


	public Professionnel(String nom, String prenom, String civilites,
			String numPort, String numDom, Adresse adresse,
			AdresseMail sonMail,String sonNumbur, AdresseMailPro MailPro) {
		super(nom, prenom, civilites, numPort, numDom, adresse, sonMail);
		this.numBur = sonNumbur;
		this.sonMailPro = MailPro;
	}

	public String getNumbur() {
		return numBur;
	}

	public void setNumbur(String numbur) {
		this.numBur = numbur;
	}

	public AdresseMailPro getSonMailPro() {
		return sonMailPro;
	}

	public void setSonMailPro(AdresseMailPro sonMailPro) {
		this.sonMailPro = sonMailPro;
	}

	@Override
	public String toString() {
		return "Professionnel ["+ this.toString2() +", numbur=" + numBur + ", sonMailPro=" + sonMailPro
				+ "]\n";

	}
	
	@Override
	public boolean equals(Object obj) {
		if (this.getClass().toString().equalsIgnoreCase(obj.getClass().toString())){
			if(this.getNom().equals(((Personne) obj).getNom()) 
			&& this.getPrenom().equals(((Personne) obj).getPrenom()) 
			&& this.getCivilites().equals(((Personne) obj).getCivilites()) 
			&& this.getNumPort().equals(((Personne) obj).getNumPort()) 
			&& this.getNumDom().equals(((Personne) obj).getNumDom()) 
			&& this.getAdresse().toString().equals(((Personne) obj).getAdresse().toString()) 
			&& this.getSonMail().toString().equals(((Personne) obj).getSonMail().toString()) 
			&& this.numBur.equals(((Professionnel) obj).getNumbur()) 
			&& this.sonMailPro.toString().equals(((Professionnel) obj).getSonMailPro().toString())) {
				return true;
			}
			else {
				return false;
			}
		}
		else {
			return false;
		}
	}
}
